﻿/*****************************************************************//**
 * @file   VAOneXMLAdaptorPhysicalPropertyRibbed.h
 * @brief  VAOne读写适配器加筋板
 *
 * @author liuzhiyuan(liuzhiyuan@diso.cn)
 * @date   2024-11-05
 *********************************************************************/
#ifndef VAONEXMLADAPTORPHYSICALPROPERTYRIBBED_H
#define VAONEXMLADAPTORPHYSICALPROPERTYRIBBED_H

#include "FITKVAOneXMLIOAPI.h"
#include "FITKAbstractVAOneXMLAdaptor.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "Tools/Win64/rapidxml/rapidxml.hpp"

namespace IO
{
    /**
     * @brief   VAOne读写适配器加筋板
     * @author  liuzhiyuan(liuzhiyuan@diso.cn)
     * @date    2024-11-05
     */
    class FITKVAOneXMLIOAPI VAOneXMLAdaptorPhysicalPropertyRibbed : public FITKAbstractVAOneXMLAdaptor
    {
        FITKCLASS(IO, VAOneXMLAdaptorPhysicalPropertyRibbed);
    public:

        /**
         * @brief   构造函数
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        explicit VAOneXMLAdaptorPhysicalPropertyRibbed()= default;
        /**
         * @brief   析构函数
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        ~VAOneXMLAdaptorPhysicalPropertyRibbed() = default;
        /**
         * @brief   适配器读数据
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool adaptR() override;
        /**
         * @brief   适配器写数据
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool adaptW() override;

    private:
        /**
         * @brief   读取加筋板数据
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool readRibbed();
        /**
         * @brief   写加筋板数据
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool writeRibbed();
        /**
         * @brief   写筋数据
         * @param[i]  r1   R1的加筋间距的标准偏差比例
         * @param[i]  r2   R2的加筋间距的标准偏差比例
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool readRibInfo(double r1, double r2);
        /**
         * @brief   写筋数据
         * @return  是否执行成功
         * @author  liuzhiyuan(liuzhiyuan@diso.cn)
         * @date    2024-11-05
         */
        bool writeRibInfo();
        /**
         * @brief 根据名称获取材料id
         * @param[i]  name   材料名称
         * @return  int id
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-11-05
         */
        int getPhyscisPropertyObjectIdByName(QString name);

        /**
         * @brief 根据id获取名称
         * @param[i]  id id
         * @return  QString name
         * @author liuzhiyuan(liuzhiyuan@diso.cn)
         * @date 2024-11-05
         */
        QString getPhyscisPropertyObjectNameById(int id);
    };
    Register2FITKIOAdaptorFactory(VAOneXML, Acoustics::FITKPhyscisPropertyRibbed, VAOneXMLAdaptorPhysicalPropertyRibbed)
}
#endif // VAONEXMLADAPTORPHYSICALPROPERTYRIBBED_H
